package com.kanshu.ksgb.fastread.doudou.common.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolUtil {
    private static final ThreadPoolUtil manager = new ThreadPoolUtil();
    //	private ArrayBlockingQueue<Runnable> queue;
    private ExecutorService service;

    private ThreadPoolUtil() {
        int num = Runtime.getRuntime().availableProcessors();
        service = Executors.newFixedThreadPool(num * 3);//2013-07-19 修改线程池数�?
//		 queue = new ArrayBlockingQueue<Runnable>(10000);
    }

    public static ThreadPoolUtil getInstance() {
        return manager;
    }

    public void addTask(Runnable runnable) {
        service.execute(runnable);

    }
}
